package com.pv.pulse;

import com.gargoylesoftware.htmlunit.ProxyConfig;

public class ProxyConnection {
	public static final String PROXY_STATUS_OPEN="OPEN";
	public static final String PROXY_STATUS_CLOSE="CLOSE";
	
	public ProxyConnection(String proxyHost, int proxyPort){
		this.proxyConfig=new ProxyConfig(proxyHost, proxyPort);
		this.proxyConfig.addHostsToProxyBypass("127.0.0.1");
		this.status=PROXY_STATUS_CLOSE;
	}
	private ProxyConfig proxyConfig;
	private String status;
	private int errorCount;
	
	public ProxyConfig getProxyConfig() {
		return proxyConfig;
	}
	public void setProxyConfig(ProxyConfig proxyConfig) {
		this.proxyConfig = proxyConfig;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	
	public int getErrorCount() {
		return errorCount;
	}
	public void ErrorCountPlus() {
		errorCount++;
		System.out.println("errorCount: "+errorCount);
	}
	public void close(){
		this.status=PROXY_STATUS_CLOSE;
	}
}
